var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');

var Sick = require('../database/mongodb.js');

/* GET home page. */
router.get('/', function(req, res, next) {
  //  res.render('index',{title:"export"});
  //  console.log(res);
  // res.send(data);
  let response = res;
  //
  Sick.find({}, (err, result, res) => {

    if (err)
    return console.log(err)
    var datas={list:result};
    // res.send(result);
    response.send(datas);
    // response.render('index', {result})
  })

});

module.exports = router;
